package cn.mystylefree.designpatternsdemo.factory;

import cn.mystylefree.designpatternsdemo.builder.Computer;

/**
 * @program my-project-model
 * @description:
 * @author: lee
 * @create: 2022/07/19 15:23
 */
public class ComputerFactory {

    public static ComputerProduct createComputer(String type) {
        ComputerProduct computer = null;

        switch (type) {
            case "lenovo":
                computer = new LenovoComputer();
                break;
            case "apple":
                computer = new AppleComputer();
                break;
        }
        return computer;
    }
}
